package de.gbeine.java.depview.model;

import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author gbeine
 *
 */
public class Feature extends Element {
    private static final Logger LOGGER = LoggerFactory.getLogger(Feature.class);

    private Class parentClass;

    public Feature(final String name) {
        super(name);
        if (Feature.LOGGER.isDebugEnabled()) {
            Feature.LOGGER.debug("New FeatureElement: " + name);
        }
    }

    public void setParentClass(final Class ce) {
        if (Feature.LOGGER.isDebugEnabled()) {
            Feature.LOGGER.debug("Parent ClassElement for FeatureElement: " + this.getName() + " set to " + ce.getName());
        }
        this.parentClass = ce;
    }

    public Class getParentClass() {
        return this.parentClass;
    }

    public Set<Feature> inboundDependencies() {
        return this.getDependencies().getInboundFeatureDependencies();
    }

    public Set<Feature> outboundDependencies() {
        return this.getDependencies().getOutboundFeatureDependencies();
    }

    @Override
    public String toString() {
        return "Feature " + this.getName();
    }

}
